﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWebElement>
#include <QListView>
#include <QHBoxLayout>
#include <QFile>
#include <QSet>
#include <QWebView>
#include <QLabel>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:

    void add_checkbox(QVector<QStringList> &companys_num);
    void add_checkbox(QSet<QString> &Unicom);
    void init();
    QString getWebtext(QWebFrame *frame,QString searchlabel=QString("table#oddsList_tab"));
    QVector<QStringList> getList(QString text);
    QVector<float> getkali(QStringList company);
    void listshow(QVector<QVector<float> > game, QListView *listview, QHBoxLayout *listcount);
    void listshow(QVector<QVector<float> > game,QListView *listview);
    void calSUM(int weight[4],QVector<QVector<float> > game);
    void calcPosibily(QListView *listView, QString matchresult);
    void predict(QListView *listView1,QListView *listView2);
    void getTeamName(QWebView *webview);
    ///////////////////////////////////////////////////////////

    void getUniCompanys();
    void getAvgOdds();
    void getAvgKaili();
    QVector<QStringList> combinate(int n, int m);
    void writelist(QStringList company,QVector<QVector<float> > game);
    void isSelect(QListView *listView);

    ///////////////////////////////////////////////////////////

    void getfenxiaddress(QWebView* webview);
    void handlefenxi(QWebView *webview);

    ///////////////////////////////////////////////////////////
    void on_lineEdit_address_1_returnPressed();

    void on_lineEdit_address_2_returnPressed();

    void on_lineEdit_address_3_returnPressed();

    void on_webView_2_loadFinished(bool arg1);

    void on_webView_1_loadFinished(bool arg1);

    void on_webView_3_loadFinished(bool arg1);

    void on_pushButton_1_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_lineEdit_address_4_returnPressed();

    void on_webView_4_loadFinished(bool arg1);

    void on_pushButton_4_clicked();

    void on_lineEdit_address_3_textChanged(const QString &arg1);

    void on_pushButton_clicked();

    void on_pushButton_5_clicked();

    void on_webView_5_loadFinished(bool arg1);

    void on_lineEdit_address_5_returnPressed();

private:
    Ui::MainWindow *ui;
    QString Webtext_1;
    QString Webtext_2;
    QString Webtext_3;
    QString Webtext_4;
    QVector<QStringList> companys_1;
    QVector<QStringList> companys_2;
    QVector<QStringList> companys_3;
    QVector<QStringList> companys_4;
    QStringList selectCompanys;
    QStringList predictResult;
    QSet<QString> UniCompanys;
    QVector<QStringList> Vec;
    int recordcount[3];
    QVector<QVector<float> > game_1;
    QVector<QVector<float> > game_2;
    QVector<QVector<float> > game_3;
    QVector<QVector<float> > game_4;
    QFile *file;
    QFile *filelist;
    int SUM[3];
    int TS[3];
    int PR[3];
    QDate date;
    QString datetext;
    QTime time;
    QString timetext;
    QVector<float> avgodds;
    QVector<float> avgkali;
    QVector<QString> bigsmall;
    QString hometeam;
    QString guestteam;
    QString league;
    QString handif;
    QString handil;

};

#endif // MAINWINDOW_H
